package com.neuedu.service.physician.impl;

import com.neuedu.bean.RestBean;
import com.neuedu.mapper.RegisterMapper;
import com.neuedu.service.physician.PhysicianPatientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class PhysicianPatientServiceImpl implements PhysicianPatientService {
    @Autowired
    private RegisterMapper registerMapper;

    //得到已经看诊完成患者人数
    @Override
    public Integer getFinishPatientCount(Integer employee_id) {
        return registerMapper.getPatientByStateCount(employee_id,"","","4");
    }
    //得到等待看诊患者人数
    @Override
    public Integer getWaitPatientCount(Integer employee_id) {
        //得到当前医生排队患者数量:医生Id、患者状态为:已完成3,日期为:当前天数
        return registerMapper.getPatientByStateCount(employee_id,"","","1");
    }
    //得到等待看诊患者信息
    @Override
    public RestBean getWaitPatient(Integer employee_id, String case_number, String real_name, Integer nowPageNumber, Integer pageSize) {
        RestBean rest = new RestBean();
        //患者信息
        List<Map<String,Object>> list =
                registerMapper.getPatientByState(employee_id,case_number,real_name,nowPageNumber,pageSize,"1");
        rest.setList(list);
        //患者数量
        Integer count = registerMapper.getPatientByStateCount(employee_id,case_number,real_name,"1");
        rest.setTotalCount(count);
        return rest;
    }
}
